package com.yanqu.road.server.timer.npc;

import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.oldplayerreturn.OldPlayerReturnModule;
import com.yanqu.road.server.gameplayer.module.manor.ManorModule;
import com.yanqu.road.server.gameplayer.module.npc.NpcEventModule;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.utils.executor.GeneralTask;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.List;


public class NpcEventTask extends GeneralTask {

    protected Logger logger = LogManager.getLogger(NpcEventTask.class.getName());

    public NpcEventTask() {

    }

    @Override
    public void doRun() {
        List<GamePlayer> playerList = GamePlayerMgr.getCopyPlayerList();
        for(GamePlayer player : playerList){
            player.getModule(NpcEventModule.class).npcLogicChange();
            player.getModule(ManorModule.class).npcTalkRefresh();
            player.getModule(OldPlayerReturnModule.class).eventRefresh();
        }
    }

}
